<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			
			<span>本例用于绑定HTML代码，而非将其当作字符串显示。</span>
			<div id="xxoo1" v-html="html">
			</div>
			<div id="xxoo2">
				{{html}}
			</div>
			<div id="xxoo3">
				<p>也可以使用v-bind来进行下级绑定</p>
				<vue-html v-bind:html="html"></vue-html>
				<hr/>
				<vue-code v-bind:html="html"></vue-code>
			</div>
		</div>
	</body>
<script type="text/javascript">
//要先注册组件再实例化
Vue.component('vue-html', {
	props: ['html'],  //props定义支持的参数绑定
	template: '<div v-html="html"></div>'
});
//要先注册组件再实例化
Vue.component('vue-code', {
	props: ['html'],  //props定义支持的参数绑定
	template: '<div>{{html}}</div>'
});
var app = new Vue({
	el: '#app',
	data: {
		html: "<p>我有一些HTML标签，<br/>你是要输出呢还是不输出？</p><hr/>",
	}
});
</script>
</html>